import { SysCustomWidgetType, OnlineFormEventType } from '@/common/staticDict/index';

const barcode = {
  span: {
    name: '组件宽度',
    widgetType: SysCustomWidgetType.Slider,
    value: 12,
    disabled: false,
    min: 1,
    max: 24,
  },
  showText: {
    name: '显示文本',
    widgetType: SysCustomWidgetType.Switch,
    value: false,
    dropdownList: [
      {
        id: false,
        name: '启用',
      },
      {
        id: true,
        name: '禁用',
      },
    ],
  },
  text: {
    name: '文本值',
    widgetType: SysCustomWidgetType.Input,
    value: '',
    props: {
      placeholder: '请输入显示文本, 为空则显示条形码值',
    },
  },
};

const barcodeConfig = {
  widgetType: SysCustomWidgetType.BARCODE,
  icon: 'online-icon icon-barcode',
  attribute: barcode,
  allowEventList: [OnlineFormEventType.VISIBLE],
  supportBindTable: true,
  supportBindColumn: true,
};

export default barcodeConfig;
